package com.commons.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author mis_wu
 * @date 2022/1/17 19:01
 */
@Slf4j
public class UserLoginInfo {

    @Autowired
    private HttpSession session;
    //存储用户信息
    public void setUserInfoConfig(String key,Object o){
        session.setAttribute(key,o);
    }
    //获取用户信息
    public Object getUserInfoConfig(String key){
        Object o=session.getAttribute(key);
        log.info("UserConfiguration userinfo:{}",o);
        return o;
    }
}
